package com.merchant.serviceimpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.merchant.dao.GoodsDao;
import com.merchant.pojo.Goods;
import com.merchant.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;


import java.util.List;

/**
 * @ClassName: GoodsServiceImpl
 * @Description: TODO 商家数据访问业务逻辑接口实现类
 * @author zgg
 * @date 2021-05-07 14:15:37
 */
@Service
public class GoodsServiceImpl implements GoodsService {
 @Autowired
 GoodsDao goodsDao;

	@Override
	public boolean addGoods(Goods goods) {
		return goodsDao.addGoods(goods)>0?true:false;
	}

	@Override
	public List<Goods> findAll() {
		return goodsDao.findAll();
	}

	@Override
	public Goods findById(int gid) {
		return goodsDao.findById(gid);
	}

	@Override
	public boolean deleteGoods(int[] array) {
		return goodsDao.deleteGoods(array)>0?true:false;
	}

	@Override
	public boolean updateGoods(Goods goods) {
		return goodsDao.updateGoods(goods)>0?true:false;
	}

	@Override
	public List<Goods> findByName(String gname) {
		return goodsDao.findByName(gname);
	}



}
